package com.graduate.work.graduatework.service;

import com.graduate.work.graduatework.entity.AirTicketDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: cuibingqi.
 * @date: 17/5/3 下午6:21.
 * @descripe:
 */
@Service
public class CollectionService {

    @Autowired
    private DataAcessService dataAcessService;

    /**
     * 用户对喜欢的航线进行收藏
     * @param airTiketDetailEntity
     */
    public boolean collectionOWAirline(AirTicketDetail airTiketDetailEntity){

        boolean result = dataAcessService.collectionOWAirline(airTiketDetailEntity);

        System.out.println(result);
        return result;

    }

    /**
     * 用户对已收藏的航线进行删除
     * @param airTiketDetailEntity
     */
    public boolean deleteOWAirline(AirTicketDetail airTiketDetailEntity){

        boolean result = dataAcessService.deleteOWAirline(airTiketDetailEntity);

        System.out.println(result);
        return result;
    }

    /**
     * 用户查看已收藏的所有航线
     */
    public List<AirTicketDetail> selectAllOWAirline(String userId){

        List<AirTicketDetail> list = dataAcessService.selectAllOWAirline(userId);

        System.out.println(list);
        return list;
    }
}
